<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var arr= [2,34,6,7,2,6,83,2,4];
			
			var toObj = function(arr){
				var obj = {};
				for(let i = 0;i<arr.length;i++)
				{
					obj[arr[i]]=arr[i];
				}
				return obj;
			}
			
			var toArr = function(obj){
				var arr = [];
				let i =0;
				for(const key of Object.keys(obj)){
					arr[i++]=key;
				}
				return arr;
				
			}
			var obj = toObj(arr);
			var arr2 = toArr(obj);
			console.log(obj)
			console.log(arr2)
		</script>
	</head>
	<body>
	</body>
</html>
